﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommonsLib.Utility;
using System.Data.SqlClient;
using MaxLeaf.Platform.Functions;
using System.Data.Common;
using MaxLeaf.Platform.Commons;

namespace MaxLeaf.Platform.DALImplementation
{
    public class imUsingListTemplateHdrDAL : BaseDAL
    {
       
        //public struct DtlSumData
        //{
        //    public int GoodsTypeCount;
        //    //public int GoodsQtyCount;
        //    //public double  TotAmt;
        //}


        //public DtlSumData GetDtlSumData(CommonsLib.DB.DBAccess dbcon, DataContract.imUsingListTemplateHdrDataModel hdrData)
        //{
        //    object hdrKeyValue=DataFunc.GetKeyValue(hdrData);
        //    DtlSumData sumData = new DtlSumData( );
        //    string strSql = "select count(*)  from (select distinct GoodsID,GoodsAttrID from imUsingListTemplateDtl where HdrID=@FInterID) a ";
        //    sumData.GoodsTypeCount = CvtFunc.ToInt(dbcon.GetValue(strSql, new SqlParameter[] { new SqlParameter("@FInterID", hdrKeyValue) }));

        //    //strSql = "select isnull(sum(ReqQty),0) as ReqQty,isnull(sum(Subtotal),0) as Subtotal  from  imUsingListTemplateDtl where FInterID=@FInterID  ";
        //    //using (DbDataReader rdr = dbcon.GetDataFirstRow(strSql, new SqlParameter[] { new SqlParameter("@FInterID", hdrKeyValue) }))
        //    //{
        //    //    if(rdr.Read())
        //    //    {
        //    //        sumData.GoodsQtyCount =CvtFunc.ToInt( rdr.GetValue(0));
        //    //        sumData.TotAmt = CvtFunc.ToDouble(rdr.GetValue(1));

        //    //    }
        //    //}
        //    return sumData;
        //}
    }
}
